import { MenuEntityPropNameEnum } from "../enums/menu-entity-prop-name.enum";

/**
 * MenuCompletedVo 类
 */
export class MenuVo {

  // 主键 ID
  [MenuEntityPropNameEnum.ID]: number;

  // 父级菜单 ID
  [MenuEntityPropNameEnum.PARENT_ID]: number | null;

  // 菜单类型 1:菜单;2:iframe;3:外链;
  [MenuEntityPropNameEnum.TYPE]: number;

  // 菜单名称
  [MenuEntityPropNameEnum.NAME]: string;

  // 页面路径
  [MenuEntityPropNameEnum.PAGE_PATH]: string | null;

  // 路由名称
  [MenuEntityPropNameEnum.ROUTE_NAME]: string | null;

  // 路由路径
  [MenuEntityPropNameEnum.ROUTE_PATH]: string | null;

  // 路由参数
  [MenuEntityPropNameEnum.ROUTE_QUERY]: string | null;

  // 链接路径
  [MenuEntityPropNameEnum.LINK_PATH]: string | null;

  // 排序
  [MenuEntityPropNameEnum.SORT]: number;

  // 图标类型 1:iconify图标;2:文本图标;3:链接图标;
  [MenuEntityPropNameEnum.ICON_TYPE]: number | null;

  // 图标
  [MenuEntityPropNameEnum.ICON]: string | null;

  // 是否禁用
  [MenuEntityPropNameEnum.DISABLED]: boolean;

  // 是否隐藏
  [MenuEntityPropNameEnum.HIDDEN]: boolean;

  // 是否缓存
  [MenuEntityPropNameEnum.CACHED]: boolean;

  // 是否开启标签页
  [MenuEntityPropNameEnum.LABELED]: boolean;

  // 在标签页中的排序
  [MenuEntityPropNameEnum.LABEL_SORT]: number;

  // 当前菜单的子菜单
  children: MenuVo[];


  constructor(
    id: number = 0,
    parentId: number | null = null,
    type: number = 0,
    name: string = "",
    pagePath: string | null = null,
    routeName: string | null = null,
    routePath: string | null = null,
    routeQuery: string | null = null,
    linkPath: string | null = null,
    sort: number = 0,
    iconType: number | null = null,
    icon: string | null = null,
    disabled: boolean = false,
    hidden: boolean = false,
    cached: boolean = false,
    labeled: boolean = false,
    labelSort: number = 0,
    children: MenuVo[] = []
  ) {
    this[MenuEntityPropNameEnum.ID] = id;
    this[MenuEntityPropNameEnum.PARENT_ID] = parentId;
    this[MenuEntityPropNameEnum.TYPE] = type;
    this[MenuEntityPropNameEnum.NAME] = name;
    this[MenuEntityPropNameEnum.PAGE_PATH] = pagePath;
    this[MenuEntityPropNameEnum.ROUTE_NAME] = routeName;
    this[MenuEntityPropNameEnum.ROUTE_PATH] = routePath;
    this[MenuEntityPropNameEnum.ROUTE_QUERY] = routeQuery;
    this[MenuEntityPropNameEnum.LINK_PATH] = linkPath;
    this[MenuEntityPropNameEnum.SORT] = sort;
    this[MenuEntityPropNameEnum.ICON_TYPE] = iconType;
    this[MenuEntityPropNameEnum.ICON] = icon;
    this[MenuEntityPropNameEnum.DISABLED] = disabled;
    this[MenuEntityPropNameEnum.HIDDEN] = hidden;
    this[MenuEntityPropNameEnum.CACHED] = cached;
    this[MenuEntityPropNameEnum.LABELED] = labeled;
    this[MenuEntityPropNameEnum.LABEL_SORT] = labelSort;
    this.children = children;
  }
}